## 封装
class Car:
    def __init__(self,make,model):
        self.make  = make
        self.model = model
        self.__speed = 0     ## 定义私有属性,外部不能直接访问

    def accelerate(self):
        self.__speed += 10
        print(f"正在加速中 当前的速度是.......: {self.__speed}  km/h")

    def brake(self):
        self.__speed -= 5
        print(f"正在减速中 当前的速度是.......: {self.__speed}  km/h")

    def get_speed(self):
        return f"当前速度为 {self.__speed}"  ##  提供公共方法 来 访问 私有属性


## 创建对象
car = Car("Audi","A8")
print(car.get_speed())
car.accelerate()
print(car.get_speed())
car.brake()
print(car.get_speed())
car.brake()
print(car.get_speed())